
    use: 'ie.ondevice.objectkit.utility.compiler.Annotation';
    use: 'ie.ondevice.objectkit.utility.compiler.ClassFile';

    AnnotationParser.implement
    (
        {
            /**
             * @private
             * The regular expression used to parse annotations from source
             * files. The general form an annotation is a javascript label
             * 
             * @example annotationname: annotationvalue;
             * 
             * Annotation values can also be quoted with single quotes
             * 
             * @example annotationname: 'annotationvalue';
             * @type {RegExp}
             * @see AnnotationParser#parseAnnotations
             */
            pattern: /\s*([a-z]+): *('[\w_\/\.]+'|[\w_\/\.]+);/g   
            
            /**
             * Parse and return any annotations declared in a class file.
             * Annotations are not removed from the source code as an aid
             * to debugging. Closure compiler will remove them for you.
             * 
             * @param {ClassFile} classFile
             * @return {Object} A collection of annotations
             * @throws {Error} If annotations could not be parsed.
             */
        ,   parseAnnotations: function (classFile) 
            {
                var annotations= {}
                ,   sourceCode= classFile.sourceCode
                ,   match
                ,   name
                ,   value
                ,   nextIndex
                ,   lastIndex
                
                while (match= this.pattern.exec(sourceCode)) 
                {
                    if (lastIndex === (nextIndex= this.pattern.lastIndex)) 
                    {
                        throw new Error('ParseError- exiting infinite exec loop.');
                    }
                    
                    lastIndex= nextIndex;
                    
                    name= match[1];
                    value=match[2];
                    
                    if ('\'' === value.charAt(0))
                        value= value.substr(1, value.length-2);
                        
                    if ('undefined' === typeof annotations[name]) 
                    {
                        annotations[name]= [];
                    }

                    annotations[name].push(new Annotation(name, value, classFile));
                }
                
                return annotations;
            }
        }
    );
    
    /**
     * @constructor
     */
    function AnnotationParser () {;}
